package com.zhuiYun.project.api.shArea.controller;

import com.zhuiYun.project.api.shArea.mapper.ShAreaMapper;
import com.zhuiYun.project.api.shArea.service.ShAreaService;
import com.zhuiYun.project.common.controller.BaseController;
import com.zhuiYun.project.common.response.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ShAreaController
 * @Description TODO 全国地址
 * @Author 胡亮
 * @Date 2023/04/15 上午 10:07
 **/
@RestController
@Api(tags = "全国地址")
@RequestMapping("/shArea")
@Slf4j
@CrossOrigin
public class ShAreaController extends BaseController {
    @Autowired
    ShAreaService shAreaService;

    /**
    * @Author 胡亮
    * @Description
    * @Date 2023/04/17 上午 10:12
    * @Return []
    */
    @GetMapping("/shAreaAll")
    @ApiOperation(value = "获取全国地址")
    public CommonResult shAreaAll(){
        log.info("获取全国地址");
        return shAreaService.shAreaAll();
    }

    /**
    * @Author gpd
    * @Description 查询所有地址信息
    * @Date 2023-04-15 上午 10:20
    * @Return com.zhuiYun.project.common.response.CommonResult

    */
    @GetMapping("/getAreaList")
    @ApiOperation(value = "查询所有地址信息")
    public CommonResult getAreaList(){
        return shAreaService.getAreaList();
    }
}
